const messageList = [];
let message = {id: 1, text: 'hello'};
messageList.push(Object.assign({}, message)); // 创建副本
console.log(messageList);

message = {id: 2, text: 'too'};
console.log(messageList);